from generator2 import generate_array
class Solution:
    def statisticalResult(self, arrayA):
        n = len(arrayA)
        if n == 0:
            return []

        # 初始化结果数组
        arrayB = [1] * n

        # 计算前缀积
        prefix = 1
        for i in range(n):
            arrayB[i] = prefix
            prefix *= arrayA[i]

        # 计算后缀积并更新结果数组
        suffix = 1
        for i in range(n - 1, -1, -1):
            arrayB[i] *= suffix
            suffix *= arrayA[i]

        return arrayB

# 测试用例
if __name__ == "__main__":
    num_test_cases = 5  
    for i in range(num_test_cases):
        test_array = generate_array()
        print(f"Test Case {i + 1}: Generated Array: {test_array}")

        solution = Solution()
        result = solution.statisticalResult(test_array)
        print(f"Statistical Result: {result}")
        print("-" * 40)